import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:fsharing/core/models/store_index.dart';
import 'package:fsharing/ui/widgets/background_container.dart';
import 'package:fsharing/ui/widgets/round_back_button.dart';

class NewsDetailPage extends StatelessWidget {
  final Link link;

  NewsDetailPage({
    Key key,
    @required this.link,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return BackgroundContainer(
      child: Scaffold(
        appBar: AppBar(
          leading: RoundBackButton(),
          title: Text('详情'),
        ),
        body: SingleChildScrollView(
          child: Container(
            padding: EdgeInsets.symmetric(horizontal: 12),
            child: Html(
              data: link.content.replaceAll(
                '<img src=\"',
                '<img src=\"https://www.lingling9.com',
              ),
            ),
          ),
        ),
      ),
    );
  }
}
